Repository navigation
Refuse to approve transaction data that no renderer can show - #2225
Draft
TheBlackBit wants to merge 1 commit into
Draft
TheBlackBit wants to merge 1 commit into
TheBlackBit wants to merge 1 commit into
Conversation
This was referenced Nov 20, 2026
TheBlackBit
force-pushed
the
feat/transaction-renderer-requirement
branch
2 times, most recently
from
November 21, 2026 00:48
8483b75 to
7bc6133
Compare
The built-in consent rendering of transaction data shows only a heading. For a type whose data the person must read to give informed consent, such as a spending permission, that is not enough: it would be approved blind. Let such a type say so, and refuse the prompt when it cannot be drawn. - `TransactionType.requiresRenderer`, default `false`, says a type's data must be shown by a renderer made for the UI toolkit in use. Existing types are unchanged. - `requestConsent()` throws `TransactionDataRendererNotAvailableException`, naming the type, before showing anything when the transaction data holds such a type and no renderer is registered for it or no repository was passed. - The Compose and SwiftUI consent dialogs refuse the same way when the registered renderer is made for the other toolkit, which counts as no renderer. `missingTransactionDataRenderer()` holds the shared check and takes what the toolkit can draw. - The public Compose and SwiftUI `Consent` views, which `RequestAuthorizationView` and `ConsentModalBottomSheet` draw directly, refuse the same way: they draw nothing, log the type's identifier and call `onCancel`. - `PresentmentData.allTransactionData` lists every item of every match, so a prompt can find out which renderers it needs before it is shown. Test: ./gradlew :multipaz:jvmTest (1885 tests, 0 failures), including the new TransactionDataRendererRequirementTest; ./gradlew :multipaz-compose:testDebugUnitTest --tests org.multipaz.compose.presentment.ConsentRequiresRendererTest (refusal by `Consent` and `requestConsent()`, which fail when those guards are removed) and --tests org.multipaz.compose.presentment.ConsentGoldenScreenshotTest; ./gradlew :multipaz-compose:compileKotlinIosSimulatorArm64 :multipaz:compileTestKotlinIosSimulatorArm64 :multipaz-compose:compileDebugKotlinAndroid detektMetadataCommonMain; xcodebuild -project samples/SwiftTestApp/SwiftTestApp.xcodeproj -scheme SwiftTestApp -sdk iphonesimulator build succeeds, compiling the SwiftUI guards. The SwiftUI guards are not exercised, as no type sets requiresRenderer yet. Signed-off-by: Ever Morales <ever.morales@koombea.com>
TheBlackBit
force-pushed
the
feat/transaction-renderer-requirement
branch
from
November 21, 2026 01:06
7bc6133 to
98128ac
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #2010
No-Issue: part of #2010, which #2196 closes
Why
The built-in consent screen shows transaction data only as a heading. For some types that is not enough: the person has to read the data to give informed consent, for example a spending permission with limits. With no renderer for such a type, the data would be approved without being shown.
This PR lets a type say that its data must be shown by a renderer, and makes the prompt refuse when it can't be. It is generic: no type sets it yet, and every existing type keeps the built-in screen. The first user is the AP2 type in #2178.
Split out of the same work as #2224, which has the SD-JWT hooks. The two don't depend on each other.
What changes
TransactionType.requiresRenderer,falseby default. A type that sets it is never approved with the built-in screen.requestConsent()throwsTransactionDataRendererNotAvailableException, naming the type, before showing anything, when such a type has no renderer in the repository or no repository was passed.missingTransactionDataRenderer()holds the shared check and takes what the toolkit can draw.Consentviews, whichConsentModalBottomSheetandRequestAuthorizationViewdraw directly, refuse the same way: they draw nothing, log the type's identifier and callonCancel.PresentmentData.allTransactionDatalists every transaction data item, so a prompt knows which renderers it needs before it is shown.The dialogs and
Consentviews are only affected when a type setsrequiresRenderer. For every other request the check finds nothing and they behave as before.Testing
./gradlew :multipaz:jvmTest: 1885 tests, 0 failures, including the newTransactionDataRendererRequirementTest.:multipaz-compose:testDebugUnitTestwith the newConsentRequiresRendererTest(ConsentandrequestConsent()refuse; both tests fail when their guard is removed, checked by removing it) andConsentGoldenScreenshotTest.detektMetadataCommonMainpasses.:multipaz-compose:compileKotlinIosSimulatorArm64,:multipaz:compileTestKotlinIosSimulatorArm64and:multipaz-compose:compileDebugKotlinAndroidpass.xcodebuild -project samples/SwiftTestApp/SwiftTestApp.xcodeproj -scheme SwiftTestApp -sdk iphonesimulator buildsucceeds, compiling the SwiftUI guards.Not verified: the guards on screen. No type sets
requiresRendereryet, so none draws a refusal.Tests pass
Appropriate changes to README are included in PR (none needed)